<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="@{include} :: header"></head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-row">
            <form class="layui-form layui-form-pane" id="signupForm">
                <input id="id" name="id" th:value="${department.id}" type="hidden">
                <input id="companyId" name="companyId" th:value="${department.companyId}" type="hidden" />

                <div class="layui-form-item">
                    <label class="layui-form-label">部门名称：</label>
                    <div class="layui-input-block">
                        <input id="name" name="name" th:value="${department.name}" onblur="nameChange()" class="layui-input" type="text">
                    </div>
                </div>

                <div class="layui-form-item" th:if="${user.roleId==1 || user.roleId==2 || user.roleId==13}">
                    <label class="layui-form-label">部门类型：</label>
                    <div class="layui-input-block">
                        <select id="deptType" name="deptType" class="layui-input" >
                            <option value="0" th:selected="${department.deptType == 0}">普通部门</option>
                            <option value="1" th:selected="${department.deptType == 1}">安全科部门</option>
                            <option value="2" th:selected="${department.deptType == 2}">电焊科</option>
                            <option value="3" th:selected="${department.deptType == 3}">高空作业部</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">负责人：</label>
                    <div class="layui-input-block">
                        <input id="headman" name="headman" th:value="${department.headman}" class="layui-input" type="text">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">电话：</label>
                    <div class="layui-input-block">
                        <input id="tel" name="tel" th:value="${department.tel}" class="layui-input" type="text">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">部门职能：</label>
                    <div class="layui-input-block">
                        <input id="functions" name="functions" th:value="${department.functions}" class="layui-input" type="text">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">地址：</label>
                    <div class="layui-input-block">
                        <input id="address" name="address" th:value="${department.address}" class="layui-input" type="text">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">备注：</label>
                    <div class="layui-input-block">
                        <textarea id="bz" name="bz" th:text="${department.bz }" placeholder="这里输入备注" style="height: 100px;resize:none;" class="layui-textarea"></textarea>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div style="text-align: center;margin-top: 20px">
                        <a onclick="update()" class="layui-btn layui-btn-normal" >提交</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:src="@{/js/appjs/module/department/detail.js}"></script>
</body>
</html>
